package actions;

import java.sql.SQLException;
import java.util.Vector;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.sql.RowSet;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import db.DbException;
import forms.StudentForm;
import model.SpecializationsModel;

public class StudentSpecialAction extends Action {

	private static final boolean DEBUG = true;
	//private static final int UNKNOWN = -1;
	
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) throws DbException {
		
		StudentForm sform = (StudentForm) form;
		String specialization = sform.getSpecialization();
		
		// save specialization into session
		request.setAttribute("specialization", specialization);
		
		sform = (StudentForm)request.getSession().getAttribute("sform");
		sform.setSpecialization(specialization);
		
		return mapping.findForward("success");
	}
}
